package sng.modules.view.components.city.logic.movement
{
	public class Directions
	{
		public static const N:String = "北";
		public static const E:String = "东";
		public static const W:String = "西";
		public static const S:String = "南";
		
		public static var turns:Array = [N, E, S, W];
		
		public static function getNextDirection(currentDirection:String):String
		{
			var currIndex:int = turns.indexOf(currentDirection);
			var nextIndex:int = (currIndex+1)>3?0:(currIndex+1);
			return turns[nextIndex];
		}
		public static function DirectionToInt(dt:String):int
		{
			if(dt==Directions.N)
			{
				return 0;
			}
			else if(dt==Directions.E)
			{
				return 1;
			}
			else if(dt==Directions.S)
			{
				return 2;
			}
			else if(dt==Directions.W)
			{
				return 3;
			}
			else
			{
				return 0;
			}
		}
	}
}